#ifndef CFACE_H
#define CFACE_H

class CVertex;
class CEdge;
class CMesh;


// PROJECT
#include "cvertex.h"
#include "cedge.h"
#include "cmesh.h"
#include "cboundingbox.h"

class CFace
{
public:
    CFace(CMesh * pParent = NULL);
    ~CFace();

    CEdge *             getEdge1();
    CEdge *     		getEdge2();
    CEdge *         	getEdge3();

    CVertex *   		getVertex1();
    CVertex *       	getVertex2();
    CVertex *           getVertex3();

    CPoint3f    		getNormal();
    bool            	isNormalSet();

    CMesh *             getParentMesh();

    void    			setEdge1(CEdge*);
    void        		setEdge2(CEdge*);
    void            	setEdge3(CEdge*);

    void    			setVertex1(CVertex*);
    void        		setVertex2(CVertex*);
    void            	setVertex3(CVertex*);

    void            	computeNormal();
    void                computeEdges();

    void                setupBB();

    CBoundingBox *      m_pBB;

protected:

    CEdge * 			m_pEdge1;
    CEdge *     		m_pEdge2;
    CEdge *         	m_pEdge3;

    CVertex *   		m_pVertex1;
    CVertex *       	m_pVertex2;
    CVertex *           m_pVertex3;

    CPoint3f    		m_Normal;
    bool            	m_bNormalSet;
    CMesh *             m_pParentMesh;
};

#endif // CFACE_H
